package com.ruoyi.system.agriculture.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruoyi.system.agriculture.domain.po.AgEquipment;
import com.ruoyi.system.agriculture.mapper.AgEquipmentMapper;
import com.ruoyi.system.agriculture.service.IAgEquipmentService;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 农业设备Service业务层处理
 */
@Service
public class AgEquipmentServiceImpl extends ServiceImpl<AgEquipmentMapper, AgEquipment> implements IAgEquipmentService {
    /**
     * 查询农业设备列表
     * 
     * @param equipment 农业设备信息
     * @return 农业设备集合
     */
    @Override
    public List<AgEquipment> selectEquipmentList(AgEquipment equipment) {
        LambdaQueryWrapper<AgEquipment> queryWrapper = new LambdaQueryWrapper<>();
        queryWrapper.like(equipment.getEquipmentName() != null, AgEquipment::getEquipmentName, equipment.getEquipmentName())
                .like(equipment.getEquipmentType() != null, AgEquipment::getEquipmentType, equipment.getEquipmentType())
                .eq(equipment.getStatus() != null, AgEquipment::getStatus, equipment.getStatus());
        return list(queryWrapper);
    }
}